const { findOne , create }= require('../models/users')
function checkNamePattern(name){
    const pattern = /^[0-9a-zA-Z_-]{4,16}$/
    return pattern.test(name)
}
async function checkNameDuplicate(name){
    return await findOne({ query : {username:name}})
}
module.exports= {
    checkNameDuplicate,
    checkNamePattern
}